<template>
  <div>
    <!--顶部-->
    <div style="display: flex;">
      <div v-if="this.parentData">
        <img width="180" height="180" :src="parentData.squareCover">
      </div>
      <div v-if="this.parentData" style="flex: 1;padding:10px;margin-left:10px;font-size:14px;font-family: 'PingFangSC-Regular', 'PingFang SC';">
        <div style="font-size: 20px;margin-bottom: 10px;">{{parentData.title}}</div>
        <div style="margin-bottom: 4px;">直播间ID：&nbsp;&nbsp;{{parentData.number}}</div>
        <div style="margin-bottom: 4px;">开播时间：&nbsp;&nbsp;{{liveDetailData.startTime}}</div>
        <div style="margin-bottom: 4px;">结束时间：&nbsp;&nbsp;{{liveDetailData.actualEndTime}}</div>
        <div style="margin-bottom: 4px;">主播昵称：&nbsp;&nbsp;{{parentData.anchorNickName}}</div>
        <div style="margin-bottom: 4px;">主播账号：&nbsp;&nbsp;{{liveDetailData.account}}</div>
      </div>
      <div style="width: 200px">
        <div style="display: flex;align-items:center;">
          <!--<div @click="liveCodeClick" style="display: flex;align-items:center;cursor:pointer;">-->
          <!--<img src="https://static4.laiyifen.com/ztdev-files/broadcast-admin-web/image/1594023656777_3424.png" width="25" height="25">-->
          <!--<div style="margin-left: 6px;">开播码</div>-->
          <!--</div>-->
          <div>
            <el-button @click="startLiveClick" type="primary" size="mini">PC推流</el-button>
          </div>
          <div style="margin-left: 30px">
            <el-button v-if="liveDetailData.status==15" @click="beginLive" type="primary" size="mini">立即开播</el-button>
            <el-button v-if="liveDetailData.status==16" @click="shutDownLive" type="primary" size="mini">关闭直播</el-button>
          </div>
        </div>
      </div>
    </div>
    <div style="height: 3px;background-color: #f1f1f1"></div>
    <div style="margin-top: 10px;display: flex;">
      <div :style="leftPanel">
        <div :style="title">数据面板</div>
        <div :style="[lineHeight,padding]">
          <div :style="itemTitle">观看数据</div>
          <div :style="item">
            <div>历史观看人数</div>
            <div>{{liveDetailData.maxOnUserNum}}</div>
          </div>
          <div :style="item">
            <div>实时在线人数</div>
            <div>{{liveDetailData.lookNum}}</div>
          </div>
          <div :style="item">
            <div>观看次数</div>
            <div>{{liveDetailData.lookSecond}}</div>
          </div>
          <!--<div :style="item">
            <div>平均观看时长</div>
            <div>{{liveDetailData.lookAverage}}</div>
                </div>-->
        </div>
        <div :style="[lineHeight,padding]">
          <div :style="itemTitle">互动数据</div>
          <div :style="item">
            <div>分享人数</div>
            <div>{{liveDetailData.shareUserNum}}</div>
          </div>
          <div :style="item">
            <div>分享次数</div>
            <div>{{liveDetailData.shareNum}}</div>
          </div>
          <div :style="item">
            <div>点赞人数</div>
            <div>{{liveDetailData.praiseUserNum}}</div>
          </div>
          <div :style="item">
            <div>点赞次数</div>
            <div>{{liveDetailData.praiseNum}}</div>
          </div>
          <div :style="item">
            <div>评论人数</div>
            <div>{{liveDetailData.commentUserNum}}</div>
          </div>
          <div :style="item">
            <div>评论次数</div>
            <div>{{liveDetailData.commentNum}}</div>
          </div>
        </div>
        <div :style="[lineHeight,padding]">
          <div :style="itemTitle">商品数据</div>
          <div :style="item">
            <div>商品累计推送</div>
            <div>{{liveDetailData.productPushNum}}</div>
          </div>
          <div :style="item">
            <div>商品点击次数</div>
            <div>{{liveDetailData.productClickNum}}</div>
          </div>
        </div>
        <div :style="[lineHeight,padding]">
          <div :style="itemTitle">本场关注数据</div>
          <div :style="item">
            <div>关注人数</div>
            <div>{{liveDetailData.followNum}}</div>
          </div>
          <div :style="item">
            <div>观看新增关注人数</div>
            <div>{{liveDetailData.followUserNum}}</div>
          </div>
          <div :style="item">
            <div>观看取消关注人数</div>
            <div>{{liveDetailData.offFollowUserNum}}</div>
          </div>
        </div>
      </div>
      <div :style="rightPanel">
        <div :style="[rightBlock,marginBottom]">
          <div style="display: flex;align-items:center;">
            <div :style="itemTitle" style="flex: 1">直播控制</div>
            <!--<el-button type="primary" size="mini" @click="closeOrOpenPlayback">{{liveDetailData.isPlayback==0?'关闭':'开启'}}回放</el-button>-->
            <el-button type="primary" size="mini" @click="prohibitOrOpenComments" >{{liveDetailData.isComment==0?'禁止':'开启'}}评论</el-button>
          </div>
          <div style="display: flex;align-items:center;">
            <div :style="marginRight">
              <div :style="controlFont.title">当前直播状态</div>
              <div :style="controlFont.item">
                <span v-if="liveDetailData.status==15">待直播&nbsp;&nbsp;</span>
                <span v-if="liveDetailData.status==16">直播中&nbsp;&nbsp;</span>
                <span v-if="liveDetailData.status==17">直播结束&nbsp;&nbsp;</span>
                <span v-if="liveDetailData.status==18">违规下线&nbsp;&nbsp;</span>
                <span v-if="liveDetailData.status==19">待编辑&nbsp;&nbsp;</span>
                <span v-if="liveDetailData.status==15" style="color: #606266">{{startLiveTime}}</span>
                <span v-if="liveDetailData.status==18" style="color: #606266">{{startLiveTime}}</span>
              </div>
            </div>
            <div :style="marginRight">
              <div :style="controlFont.title">直播时长</div>
              <div :style="controlFont.item">{{liveTime}}</div>
            </div>
            <div :style="marginRight">
              <div :style="controlFont.title">当前时间</div>
              <div :style="controlFont.item">{{currentTime}}</div>
            </div>
            <div :style="marginRight">
              <div :style="controlFont.title">回放</div>
              <div :style="controlFont.item">{{liveDetailData.isPlayback==0?'开启':'关闭'}}</div>
            </div>
            <div :style="marginRight">
              <div :style="controlFont.title">评论</div>
              <div :style="controlFont.item">{{liveDetailData.isComment==0?'开启':'禁止'}}</div>
            </div>
            <div style="flex: 1;text-align: right;margin-top: 10px;">
              <el-button size="mini" @click="userBaneClick">评论管理</el-button>
            </div>
          </div>
        </div>
        <div :style="[rightBlock,marginBottom]">
          <div :style="itemTitle">推屏显示</div>
          <!--商品推屏-->
          <live-controller-shop-push-screen v-if="currentTab===0" :data="parentData" ref="shopPushScreen"></live-controller-shop-push-screen>
          <!--抽奖-->
          <live-controller-lucky-draw-push-screen v-else-if="currentTab===1" :data="parentData" ref="luckyDrawPushScreen"></live-controller-lucky-draw-push-screen>
          <!--公告-->
          <live-controller-notice-push-screen v-else-if="currentTab===2" :data="parentData" @pushScreenHandle="pushScreenHandle" ref="noticePushScreen"></live-controller-notice-push-screen>
          <!--跑马灯-->
          <live-controller-marquee-push-screen v-else-if="currentTab===3" :data="parentData" @pushScreenHandle="pushScreenHandle" ref="marqueePushScreen"></live-controller-marquee-push-screen>
          <!--优惠券-->
          <live-controller-coupons-push-screen v-else-if="currentTab===4" :data="parentData" ref="couponsPushScreen"></live-controller-coupons-push-screen>
          <!--无聊群-->
          <live-controller-group-push-screen v-else-if="currentTab===5" :data="parentData" ref="groupPushScreen"></live-controller-group-push-screen>
          <!--运营位-->
          <live-controller-operating-push-screen v-else-if="currentTab===6" :data="parentData" ref="operatingPushScreen"></live-controller-operating-push-screen>
        </div>
        <div :style="[rightBlock]">
          <div style="display: flex;">
            <div :style="itemTitle" style="flex: 1;">推送控制</div>
            <div>
              <el-button v-if="currentTab===0" size="mini" type="primary" @click="addShopClick">添加商品</el-button>
              <el-button v-if="currentTab===1" size="mini" type="primary" @click="addShopClick">创建抽奖</el-button>
              <el-button v-if="currentTab===2" size="mini" type="primary" @click="addShopClick">添加公告</el-button>
              <el-button v-if="currentTab===3" size="mini" type="primary" @click="addShopClick">添加跑马灯</el-button>
              <el-button v-if="currentTab===4" size="mini" type="primary" @click="addShopClick">添加优惠券</el-button>
              <el-button v-if="currentTab===5" size="mini" type="primary" @click="addShopClick">添加无聊群</el-button>
              <el-button v-if="currentTab===6" size="mini" type="primary" @click="addShopClick">创建运营活动</el-button>
            </div>
          </div>
          <div style="display:flex;border:1px solid #eeeded;padding: 10px 20px;margin-top: 10px; border-radius:3px;">
            <div :style="[tabStyle, currentTab===0?textGreen:'']" @click="selectTab(0)">商品</div>
            <div :style="[tabStyle, currentTab===1?textGreen:'']" @click="selectTab(1)">抽奖</div>
            <div :style="[tabStyle, currentTab===2?textGreen:'']" @click="selectTab(2)">公告</div>
            <div :style="[tabStyle, currentTab===3?textGreen:'']" @click="selectTab(3)">跑马灯</div>
            <div :style="[tabStyle, currentTab===4?textGreen:'']" @click="selectTab(4)">优惠券</div>
            <div :style="[tabStyle, currentTab===5?textGreen:'']" @click="selectTab(5)">无聊群</div>
            <div :style="[tabStyle, currentTab===6?textGreen:'']" @click="selectTab(6)">运营位</div>
          </div>
          <!--商品-->
          <live-controller-shop-manage v-if="currentTab===0" ref="shopManage" :data="parentData" @pushScreen="pushScreen"></live-controller-shop-manage>
          <!--抽奖-->
          <live-controller-lucky-draw-manage v-else-if="currentTab===1" ref="luckyDrawManage" :data="parentData" @pushScreen="pushScreen"></live-controller-lucky-draw-manage>
          <!--公告-->
          <live-controller-notice-manage v-else-if="currentTab===2" ref="noticeManage" :data="parentData" @pushScreen="pushScreen"></live-controller-notice-manage>
          <!--跑马灯-->
          <live-controller-marquee-manage v-else-if="currentTab===3" ref="marqueeManage" :data="parentData" @pushScreen="pushScreen"></live-controller-marquee-manage>
          <!--优惠券-->
          <live-controller-coupons-manage v-else-if="currentTab===4" ref="couponsManage" :data="parentData" @pushScreen="pushScreen"></live-controller-coupons-manage>
          <!--无聊群-->
          <live-controller-group-manage v-else-if="currentTab===5" ref="groupManage" :data="parentData" @pushScreen="pushScreen"></live-controller-group-manage>
          <!--运营位-->
          <live-controller-operating-manage v-else-if="currentTab===6" ref="operatingManage" :data="parentData" @pushScreen="pushScreen"></live-controller-operating-manage>
        </div>
      </div>
    </div>

    <el-dialog
      title="开播码"
      :visible.sync="codeDialogVisible"
      width="30%"
      center
      append-to-body>
      <div style="text-align: center;">
        <img width="240" height="240" src="https://static4.laiyifen.com/ztdev-files/broadcast-admin-web/image/1594023656777_3424.png">
      </div>
    </el-dialog>

    <el-dialog
      title="发起直播"
      :visible.sync="startLiveDialogVisible"
      width="60%"
      append-to-body>
      <div style="padding: 10px 30px;">
        <div style="background-color: #f1f1f1;padding: 20px;line-height: 50px">
          <div :style="textXl" style="color: #333333">电脑直播</div>
          <div :style="textXl" style="color: #AAAAAA">通过电脑OBS推流软件开始直播</div>
          <div :style="textXl" style="color: #AAAAAA">
            <span style="color: #39b2a2">推流密钥：</span>
            <span style="font-size: 20px;">{{pushFlowKey}}</span>
            <el-button @click="copy" type="primary" size="small" style="width: 100px;margin-left: 50px;">复制</el-button>
          </div>
        </div>
      </div>
    </el-dialog>

    <el-dialog
      title="禁言用户"
      :visible.sync="userBanDialogVisible"
      width="80%"
      append-to-body
      @opened="userBanOpened">
      <live-controller-user-ban ref="controllerUserBan" :data="parentData"></live-controller-user-ban>
    </el-dialog>
  </div>
</template>
<script>
  import LiveControllerUserBan from "./component/LiveControllerUserBan";
  import LiveControllerShopManage from "./component/LiveControllerShopManage";
  import LiveControllerLuckyDrawManage from "./component/LiveControllerLuckyDrawManage";
  import LiveControllerNoticeManage from "./component/LiveControllerNoticeManage";
  import LiveControllerMarqueeManage from "./component/LiveControllerMarqueeManage";
  import LiveControllerCouponsManage from "./component/LiveControllerCouponsManage";
  import LiveControllerGroupManage from "./component/LiveControllerGroupManage";
  import LiveControllerOperatingManage from "./component/LiveControllerOperatingManage";
  import LiveControllerShopPushScreen from "./component/LiveControllerShopPushScreen";
  import LiveControllerLuckyDrawPushScreen from "./component/LiveControllerLuckyDrawPushScreen";
  import LiveControllerNoticePushScreen from "./component/LiveControllerNoticePushScreen";
  import LiveControllerMarqueePushScreen from "./component/LiveControllerMarqueePushScreen";
  import LiveControllerCouponsPushScreen from "./component/LiveControllerCouponsPushScreen";
  import LiveControllerGroupPushScreen from "./component/LiveControllerGroupPushScreen";
  import LiveControllerOperatingPushScreen from "./component/LiveControllerOperatingPushScreen";
  export default {
    components: {
      LiveControllerUserBan,
      LiveControllerShopManage,
      LiveControllerLuckyDrawManage,
      LiveControllerNoticeManage,
      LiveControllerMarqueeManage,
      LiveControllerCouponsManage,
      LiveControllerGroupManage,
      LiveControllerOperatingManage,
      LiveControllerShopPushScreen,
      LiveControllerLuckyDrawPushScreen,
      LiveControllerNoticePushScreen,
      LiveControllerMarqueePushScreen,
      LiveControllerCouponsPushScreen,
      LiveControllerGroupPushScreen,
      LiveControllerOperatingPushScreen,
    },
    props:{
      data:{
        type: Object,
        default:()=>{}
      }
    },
    data() {
      return {
        timer:null,
        title:{
          'font-size':'16px',
          'color':'#000000'
        },
        leftPanel:{
          'width':'200px',
          'padding':'15px',
          'border':'2px solid #f1f1f1'
        },
        rightPanel:{
          'flex':1,
          'margin-left': '20px'
        },
        rightBlock:{
          'padding':'15px',
          'border':'2px solid #f1f1f1'
        },
        marginBottom:{
          'margin-bottom':'15px'
        },
        lineHeight:{
          'line-height':'28px'
        },
        itemTitle:{
          'font-size':'14px',
          'color':'#000000'
        },
        item:{
          'display': 'flex',
          'font-size':'12px',
          'justify-content':'space-between',
          'font-family': '黑体'
        },
        padding:{
          'padding':'8px'
        },
        marginRight:{
          'margin-right':'70px'
        },
        controlFont:{
          title:{
            'font-size':'12px',
            'font-family': '黑体',
            'margin-bottom': '4px',
          },
          item:{
            'font-size':'12px',
            'color': '#000000'
          }
        },
        tabStyle:{
          'width':'100px',
          'cursor':'pointer',
          'font-size':'12px'
        },
        textGreen:{
          'color':'#39B3A3'
        },
        headerCellStyle:{
          'background-color': '#f1f1f1',
          'font-size':'12px',
          'color':'#000000'
        },
        cellStyle:{
          'font-size':'12px'
        },
        textXl:{
          'font-size':'24px'
        },
        currentTab: 0,
        codeDialogVisible:false,
        startLiveDialogVisible:false,
        userBanDialogVisible:false,
        addShopDialogVisible:false,
        pushFlowKey:'',
        parentData: null,// 父组件传递的参数
        liveDetailData:{
          maxOnUserNum:0,
          lookNum:0,
          lookAverage:0,
          shareUserNum:0,
          shareNum:0,
          praiseUserNum:0,
          praiseNum:0,
          commentUserNum:0,
          commentNum:0,
          productPushNum:0,
          productClickNum:0,
          followNum:0,
          followUserNum:0,
          offFollowUserNum:0,
          id:'',
          number:'',
          title:'',
          actualStartTime:'',
          actualEndTime:'',
          startTime:'',
          isComment:0,
          isPlayback:0,
          account:'',
          nickName:'',
        },
        currentTime:'',
        startLiveTime:'',
        liveTime:'00:00:00',
      }
    },
    watch:{
      data:function (newVal,oldVal) {
        this.parentData = newVal
        // 重置控制台
        if(this.parentData) {
          this.init()
          this.getDataList();
        } else {
          this.clearTimer();
          this.timer=null;
          // 清除商品组件定时器
          if(this.$refs.shopManage){
            this.$refs.shopManage.clearTimer()
            this.$refs.shopPushScreen.clearTimer()
          }
          // 清除抽奖组件定时器
          if(this.$refs.luckyDrawManage){
            this.$refs.luckyDrawManage.clearTimer()
            this.$refs.luckyDrawPushScreen.clearTimer()
          }
          // 清除跑马灯组件定时器
          if(this.$refs.marqueeManage){
            this.$refs.marqueeManage.clearTimer()
            this.$refs.marqueePushScreen.clearTimer()
          }
          // 清除无聊群组件定时器
          if(this.$refs.groupManage){
            this.$refs.groupManage.clearTimer()
            this.$refs.groupPushScreen.clearTimer()
          }
          this.clearTimer();
          this.startLiveTime='';
          this.liveTime='00:00:00';
        }
      },
    },
    mounted: function () {
      this.parentData = this.data
      // 初次加载-初始化商品信息
      this.init()
      this.getDataList();
    },
    methods: {
      init(){
        this.currentTab = 0
        if(this.$refs.shopManage){
          this.$refs.shopManage.init(this.parentData)
          this.$refs.shopPushScreen.init(this.parentData)
        };
      },
      initTime() {
        let timesp=null;
        let i=1;
        let currTime = new Date();
        this.timer = setInterval(() => {
          if(i==5 && ( this.liveDetailData.status==15 || this.liveDetailData.status==16)){
            this.getDataList();
            i=0;
          }
          i++;
          let h = currTime.getHours()<10?'0'+currTime.getHours():currTime.getHours();
          let m = currTime.getMinutes()<10?'0'+currTime.getMinutes():currTime.getMinutes();
          let s = currTime.getSeconds()<10?'0'+currTime.getSeconds():currTime.getSeconds();
          if(this.liveDetailData.status==15){
            timesp =(new Date(this.liveDetailData.startTime)-currTime)/1000;
            if(timesp<0){
              timesp=-timesp;
              this.startLiveTime='直播超时';
            }else{
              this.startLiveTime='倒计时'
            }
          }
          if(this.liveDetailData.status==16){
            timesp=(currTime-new Date(this.liveDetailData.actualStartTime))/1000;
          }
          let day = Math.floor(timesp/60/60/24);
          let hour  = Math.floor(timesp/60/60%24);
          hour  = hour<10?'0'+hour:hour;
          let minute  = Math.floor(timesp/60%60);
          minute  = minute<10?'0'+minute:minute;
          let second  = Math.floor(timesp%60);
          second  = second<10?'0'+second:second;
          this.currentTime=h+":"+m+":"+s;
          if(this.liveDetailData.status==15){
            this.startLiveTime=this.startLiveTime+day+'天'+hour+'小时'+minute+'分'+second+'秒';
          }
          if(this.liveDetailData.status==16){
            this.liveTime=hour+":"+minute+":"+second;
          }
          currTime = new Date();
        },1000)
      },
      getDataList(){
        let params={};
        params.id=this.parentData.id;
        params.number=this.parentData.number;
        this.utils.request.liveRequest({
          url: '/api/v1/liveData/getLiveConData',
          method:'get',
          params: params
        }).then(result => {
          let data = result.data;
          if (data && data.code == "0") {
            this.liveDetailData=data.data;
            if(data.data.lookAverage>0 && data.data.lookNum>0 ){
              this.liveDetailData.lookAverage=Math.floor((data.data.lookAverage/data.data.lookNum)*100)/100
            }
            if(this.timer==null){
              this.initTime();
            }
          }
        })
      },
      clearTimer(){ // 清除定时器
        clearInterval(this.timer)
      },
      closeOrOpenPlayback(){
        let id = this.parentData.id;
        let isPlayback=0;
        let hint="确认开启回放功能吗？";
        if(this.liveDetailData.isPlayback==0){
          hint="确认关闭回放功能吗？";
          isPlayback=1;
        }
        this.$confirm(hint, "提示", {}).then(() => {
          let param = {"id": id, "isPlayback": isPlayback};
          this.utils.request.liveRequest({
            url: '/api/v1/liveInfo/closeOrOpenPlayback',
            method: 'post',
            params: param
          }).then(result => {
            let data = result.data;
            if (data.code === '0') {
              this.liveDetailData.isPlayback=isPlayback;
              this.$message({message: "操作成功", type: "info"});
            }else{
              this.$message({message: "操作失败", type: "error"});
            }
          })
        });
      },
      prohibitOrOpenComments(){
        let id = this.parentData.id;
        let isComment=0;
        let hint="确认开启评论吗？";
        if(this.liveDetailData.isComment==0){
          hint="确认禁止评论吗？";
          isComment=1;
        }
        this.$confirm(hint, "提示", {}).then(() => {
          let param = {"id": id, "isComment": isComment ,"number": this.liveDetailData.number};
          this.$http({
            url: '/api/v1/liveInfo/prohibitOrOpenComments',
            method: 'post',
            params: param
          }).then(result => {
            let data = result.data;
            if (data.code === '0') {
              this.liveDetailData.isComment=isComment;
              this.$message({message: "操作成功", type: "info"});
            }else{
              this.$message({message: "操作失败", type: "error"});
            }
          })
        });
      },
      selectTab(val){
        this.currentTab = val
      },
      liveCodeClick(){ // 显示开播码
        this.codeDialogVisible = true
      },
      startLiveClick(){ // 显示立即开播时间
        this.pushFlowKey=this.parentData.pushAddress;
        this.startLiveDialogVisible = true
      },
      beginLive(){ // 立即开播
        this.$confirm('确认要立即开播？')
          .then(_ => {
            this.utils.request.liveRequest({
              url: '/api/v1/liveInfo/start/'+this.parentData.id,
              method: 'post'
            }).then(result => {
              let data = result.data;
              if (data.code == "0") {
                this.$message({message: "操作成功", type: "success"});
              }else{
                this.$message({message: "操作失败", type: "error"});
              }
            })
          })
          .catch(_ => {});
      },
      shutDownLive(){ // 关闭开播
        this.$confirm('确认要关闭开播？')
          .then(_ => {
            this.utils.request.liveRequest({
              url: '/api/v1/liveInfo/shutDown/'+this.parentData.id,
              method: 'post'
            }).then(result => {
              let data = result.data;
              if (data.code == "0") {
                this.$message({message: "操作成功", type: "success"});
              }else{
                this.$message({message: "操作失败", type: "error"});
              }
            })
          })
          .catch(_ => {});
      },
      userBaneClick(){ // 显示评论管理窗口
        this.userBanDialogVisible = true
      },
      userBanOpened(){ // 评论管理窗口打开动画结束回调
        this.$refs.controllerUserBan.getList()
      },
      addShopClick(){
        if(this.currentTab===0){
          this.$refs.shopManage.dialogVisible=true
        } else if(this.currentTab===1){
          this.$refs.luckyDrawManage.dialogVisible=true
        } else if(this.currentTab===2){
          this.$refs.noticeManage.dialogVisible=true
        }else if(this.currentTab===3){
          this.$refs.marqueeManage.dialogVisible=true
        }else if(this.currentTab===4){
          this.$refs.couponsManage.dialogVisible=true
        }else if(this.currentTab===5){
          this.$refs.groupManage.dialogVisible=true
        }else if(this.currentTab===6){
          this.$refs.operatingManage.dialogVisible=true
        }
      },
      copy(){ //复制
        let createInput = document.createElement("input");
        createInput.value = this.pushFlowKey;
        document.body.appendChild(createInput);
        createInput.select(); // 选择对象
        document.execCommand("Copy"); // 执行浏览器复制命令
        createInput.style.display = "none";
        this.$message({
          message: '复制成功',
          type: 'success'
        });
      },
      pushScreen(row){ // 推屏
        if(this.currentTab===0){ // 商品
          this.$refs.shopPushScreen.pushScreen(row)
        } else if(this.currentTab===1){ // 抽奖
          this.$refs.luckyDrawPushScreen.pushScreen(row)
        } else if(this.currentTab===2){ // 公告
          this.$refs.noticePushScreen.pushScreen(row)
        }else if(this.currentTab===3){ // 跑马灯
          this.$refs.marqueePushScreen.pushScreen(row)
        }else if(this.currentTab===4){ // 优惠券
          this.$refs.couponsPushScreen.pushScreen(row)
        }else if(this.currentTab===5){ // 无聊群
          this.$refs.groupPushScreen.pushScreen(row)
        }else if(this.currentTab===6){ // 运营位
          this.$refs.operatingPushScreen.pushScreen(row)
        }
      },
      pushScreenHandle(row){

        if(this.currentTab===0){ // 商品

        } else if(this.currentTab===1){ // 抽奖

        } else if(this.currentTab===2){ // 公告
          this.$refs.noticeManage.pushScreenHandle(row)
        }else if(this.currentTab===3){ // 跑马灯
          this.$refs.marqueeManage.offPushScreen(row)
        }else if(this.currentTab===4){ // 优惠券

        }else if(this.currentTab===5){ // 无聊群

        }else if(this.currentTab===6){ // 运营位
          this.$refs.operatingManage.pushScreenHandle(row)
        }
      }
    }
  }
</script>
<style scoped lang="scss">

</style>
